<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改文件台账')" />
    <th:block th:include="include :: datetimepicker-css" />
    <th:block th:include="include :: select2-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-propertyAccount-edit" th:object="${propertyAccount}">
            <input name="accountId" class="form-control" type="hidden" th:field = "*{accountId}">
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">序号：</label>
                <div class="col-sm-8">
                    <input name="num" class="form-control" type="text" th:field = "*{num}" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">文件内容：</label>
                <div class="col-sm-8">
                    <input name="fileContent" class="form-control" type="text" th:field = "*{fileContent}" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">类型：</label>
                <div class="col-sm-8">
                    <select name="type" class="form-control" th:field="*{type}" required>
                        <option value="1">上级</option>
                        <option value="2">公司</option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">日期：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input autocomplete="off" type="text" class="time-input form-control" id="date" th:value="*{#dates.format(date, 'yyyy-MM-dd')}" placeholder="请填写日期" name="date" required/>
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">备注：</label>
                <div class="col-sm-8">
                    <input name="comment" class="form-control" type="text" th:value="*{comment}">
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <th:block th:include="include :: select2-js" />
    <script th:inline="javascript">
        var prefix = ctx + "hrm/propertyAccount";
        /*将后台的值传入前台*/
        var propertyAccount = [[${propertyAccount}]];

        /*$(document).ready(function(){initChoice();})的简写
        * function () {}里面的内容是在页面都加载完才执行*/
        $(function () {

        })

        $("#form-propertyAccount-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-propertyAccount-edit').serialize());
            }
        }

        $("input[name='date']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "date",
            autoclose: true
        });

    </script>
</body>
</html>